package com.ssy.lingxi.product.handler.init;

import com.ssy.lingxi.product.service.FreightSpaceService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 服务启动时redis库存初始化类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/7/29
 */
@Data
@Component
@Order(value = 1)
public class FreightSpaceHandler implements ApplicationRunner {

    @Autowired
    private FreightSpaceService freightSpaceService;

    @Override
    public void run(ApplicationArguments args) {
        try{
            freightSpaceService.syncFreightSpace();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

